package com.example.demo.queue.blockingQueue;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @desc:
 * @author: fuxiang
 * @date: 2018/8/30 17:00
 */
public class Test {

    public static void main(String[] args) {
        ExecutorService cachedThreadPool = Executors.newCachedThreadPool();
        Producer producer = new Producer("01生产朱");
        Producer producer2 = new Producer("02生产朱");
        Consumer consumer = new Consumer("01消费者");
        cachedThreadPool.submit(producer);
        cachedThreadPool.submit(producer2);
        cachedThreadPool.submit(consumer);
    }
}
